#include "string.h"
#include <string.h>
#define MAX 100
String::String(unsigned int max)
{
	nb=0;
	tab=new char[max];

}
String::~String()
{
	delete[] tab;
}
String::String(const String& S)
{
	nb=S.nb;
	tab=new char[MAX];
	for(unsigned int i=0;i<nb;i++)
	{
		tab[i]=S.tab[i];
	}
}
char& String::operator[](unsigned int i)
{
	return tab[i];
}
void String::ajouter_fin(char s)
{
	if(nb<MAX)
	{
		tab[nb]=s;
		nb++;
	}
}
ostream& operator<<(ostream& out,const String& S)
{
	for(unsigned int i=0;i<S.nb;i++)
	{
		out<<"tab de :"<<i<<"="<<S.tab[i]<<endl;
	}
return out;
}

/*char* String::operator+(const String& S)
{
	char* t;
	t=strcat(this,S);
return t;
}


char* String::operator=(const String& S)
{
	char* t;
	if(this!=&S)
	{
		delete[] tab;
		//nb=S.nb;
		//tab= new char[MAX];
		t=strcpy(this,S);
	}
return t ;
}*/
